package org.itboys.mobile.dto;

import java.math.BigDecimal;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 描述：天街_金融_充值产品_dto。
 */

public class TianJieWalletProductDto extends MobileBaseDto{
    private BigDecimal amount;//总余额
    private Integer type;//1,消费卡充值，2游戏充值
    private String gameAmount;//游戏币数量
    private Integer gameAmountOld;//游戏币数量

    public TianJieWalletProductDto() {
    }

    public TianJieWalletProductDto(long id, String createTime, String createDate, BigDecimal amount, Integer type,Integer gameAmountOld) {
        super(id, createTime, createDate);
        this.amount = amount;
        this.type = type;
        this.gameAmountOld=gameAmountOld;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getGameAmount() {
        if(gameAmountOld==null)return null;
        if(gameAmountOld>=100000000) {
            gameAmount = gameAmountOld / 100000000 + "亿";
        }else if(gameAmountOld>=10000000){
            gameAmount=gameAmountOld/10000000+"千万万";
        }else if(gameAmountOld>=1000000) {
            gameAmount = gameAmountOld / 1000000 + "百万";
        }else if(gameAmountOld>=100000){
            gameAmount=gameAmountOld/100000+"十万";
        }else if(gameAmountOld>=10000){
            gameAmount=gameAmountOld/10000+"万";
        }else if(gameAmountOld>=1000){
            gameAmount=gameAmountOld/1000+"千";
        }else{
            gameAmount=String.valueOf(gameAmountOld);
        }
        return gameAmount;
    }

    public void setGameAmount(String gameAmount) {
        this.gameAmount = gameAmount;
    }

    public Integer getGameAmountOld() {
        return gameAmountOld;
    }

    public void setGameAmountOld(Integer gameAmountOld) {
        this.gameAmountOld = gameAmountOld;
    }

    /**
     * 状态的中文信息
     */
    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;

        switch (type) {
            case 1:
                typeStr="消费卡充值类产品";
                break;
            case 2:
                typeStr="游戏充值类产品";
                break;
            default:
                break;
        }
        return typeStr;
    }
/*    public String gameAmountStr(){
        String gameAmountStr="";
        if(gameAmountOld==null)return gameAmountStr;
        if(gameAmountOld>1000){
            gameAmountStr=gameAmountOld/1000+"千";
        }else if(gameAmountOld>10000){
            gameAmountStr=gameAmountOld/10000+"万";
        }else{
            gameAmountStr=String.valueOf(gameAmount);
        }
        return gameAmountStr;
    }*/
    public String getInfo(){
        return "字段说明：1，amount:充值金额,2,gameAmountStr:对应游戏币数量(字符串)，3，type:充值类型（1消费卡充值2游戏充值）";
    }
}
